import Vue from 'vue'
import VueRouter from 'vue-router'
import baseLayout from '../components/layout/base.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    // component: HomeView
    redirect: '/ai'
  },
  {
    path: '/login',
    name: 'login',
    component: () => import(/* webpackChunkName: "login" */ '../views/login/index.vue')
  },
  {
    path: '/reg',
    name: 'reg',
    component: () => import(/* webpackChunkName: "reg" */ '../views/reg/index.vue')
  },
  {
    path: '',
    component: baseLayout,
    children: [
      {
        path: '/about',
        name: 'about',
        component: () => import(/* webpackChunkName: "about" */ '../views/about/index.vue')
      },
      {
        path: '/ai',
        name: 'ai',
        component: () => import(/* webpackChunkName: "ai" */ '../views/ai/index.vue')
      },
      {
        path: '/kindergarten',
        name: 'kindergarten',
        component: () => import(/* webpackChunkName: "kindergarten" */ '../views/kindergarten/index.vue')
      },
      {
        path: '/shop',
        name: 'shop',
        component: () => import(/* webpackChunkName: "shop" */ '../views/shop/index.vue')
      }
    ]
  },

]

const router = new VueRouter({
  mode: 'hash',
  base: process.env.BASE_URL,
  routes,
  scrollBehavior() {
    return { x: 0, y: 0 }
  }
})

export default router
